<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="grant_code"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
<c:set var="sub_grant_code"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>

<div class="t_bar">项目投入资金预算（单位：万元）</div>
<table class="table01 t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1">
	<tr>
	    <td width="200" align="left">1、总投资</td>
		<td colspan="3">
			<input id="invest_total" name="budget/invest_detail/total" label="总投资" type="text" disabled
					class="input_text gray "  style="text-align:right" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/total" />" /> 
		</td>
	</tr>
	<tr>
	    <td rowspan="2"><span class="color_red">*</span>2、申请本资助前已完成的投资额</td>
	    <td>自筹资金</td>
	    <td colspan="2">
			<input id="invest_finish_seft" name="budget/invest_detail/finish_seft" label="项目投入资金预算中申请本资助前已完成的投资额中的自筹资金" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/finish_seft" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
		</td>
	</tr>
	<tr>
	   <td>国家、省、市拨款</td>
	   <td colspan="2">
			<input id="invest_finish_country" name="budget/invest_detail/finish_country" label="项目投入资金预算中申请本资助前已完成的投资额中的国家、省、市拨款" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/finish_country" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
		</td>
	</tr>
	<tr>
	   <td rowspan="3"><span class="color_red">*</span>3、还需要投入的投资额</td>
	   <td>自筹资金</td>
	   <td colspan="2">
			<input id="invest_need_seft" name="budget/invest_detail/need_seft" label="项目投入资金预算中还需要投入的投资额中的自筹资金" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/need_seft" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
	    </td>
	</tr>
	<tr>
	   <td>国家、省、市拨款</td>
	   <td colspan="2">
			<input id="invest_need_country" name="budget/invest_detail/need_country" label="项目投入资金预算中还需要投入的投资额中的国家、省、市拨款" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/need_country" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
	    </td>
	</tr>
	<tr>
	   <td>申请区科技研发资金</td>
	   <td colspan="2">
			<input id="invest_need_amt" name="budget/invest_detail/need_amt" label="项目投入资金预算中还需要投入的投资额中的申请区科技研发资金" type="text"
					class="input_text required percentCompare:invest_total:50"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/need_amt" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
	    </td>
	</tr>
</table>
<br>
   <table border="0" cellspacing="0" cellpadding="0"  class="" width="100%">
       <tr>
		   <td>
		        <b>注：每个项目资助额不高于项目预算总投资额的50%，且年度资助金额不超过300万元，可连续支持不超过三年，项目累计资助总额不超过500万元。&nbsp;</b><br>
		   </td>
		<tr>
    </table>
<br>
<div class="t_bar"><span class="color_red">*</span>项目资金使用计划</div>
<table class="table01" width="100%" border="0" cellpadding="0"
	id="tblfinancialplans" cellspacing="1">
    <thead>
		<tr>
			<th class="TblHead" align="center" width="10%">选择</th>
			<th class="TblHead" align="center" width="10%">序号</th>
			<th class="TblHead" align="center" width="20%">使用金额（万元） </th>
			<th class="TblHead" align="center" width="70%">用途 </th>
		</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td style="text-align:center;">&nbsp;
							<input type="radio" class="radiobutton" name="selfinancialplans" >
						</td>
						<td style="text-align:center;">&nbsp;
							<span name="financialplans|financialplan[0]@seq_no" >[index]</span> 
						</td>
						<td style="text-align:center;">
							<input type="text" size="35" name="financialplans|financialplan[0]|money" class="input_text required talflag" 
							style="text-align:right;width:100px"  
							maxlength=50 label="使用金额" value="" onfocus="InitInput.setNumber(this,7,4,2)" onchange="countTable('tblfinancialplans','financialplans_total','2')"/>&nbsp;
						</td>
						<td style="text-align:center;">
							<input type="text" size="70" name="financialplans|financialplan[0]|use" 
							style='width:90%'
							class="input_text required talflag" maxlength=200 label="用途" value="" />&nbsp;
						</td>
					</tr>
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/financialplans/financialplan" var="financialplan">
					<c:choose>
						<c:when test="${index<10}" >
						<c:set value="0" var="flag" scope="page"/>
						</c:when>
						<c:otherwise>
						<c:set value="" var="flag" scope="page"/>
						</c:otherwise>
					</c:choose>
					<tr>
						<td style="text-align:center;">&nbsp;
							<input type="radio" class="radiobutton" name="selfinancialplans" >
						</td>
						<td style="text-align:center;">
							<span name="financialplans/financialplan[${flag}${index}]@seq_no" >${index+1}</span> 
						</td>
						<td style="text-align:center;">
							<input type="text"  name="financialplans/financialplan[${flag}${index}]/money" 
							class="input_text required talflag" maxlength=50 label="使用金额"  size="35"
							style="text-align:right;width:100px" 
							onfocus="InitInput.setNumber(this,7,4,2)"
							onchange="countTable('tblfinancialplans','financialplans_total','2')"
							value="<x:out select="$financialplan/money" />" />&nbsp;
						</td>
						<td style="text-align:center;">
							<input type="text"  name="financialplans/financialplan[${flag}${index}]/use" 
							class="input_text required talflag" maxlength=200 label="用途"  size="70"
							style='width:90%'
							value="<x:out select="$financialplan/use" />" />&nbsp;
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
			</table>
			<table class="t_css" cellpadding="0" cellspacing="0" width="100%" id='orgInfo2'align="center">
                <tr>
		            <td align="right" class="thclass" width="40px">合计：</td>
		            <td colspan="1" class="thclass" width="120px">
			           <input id="financialplans_total" name="financialplans/total" label="项目资金使用计划合计" type="text" disabled
					     class="input_text gray valueEqual:financialplans_total:invest_total"  style="text-align:right" size="35" onfocus="InitInput.setNumber(this,7,4,2)"
					     value="<x:out select="$xmlData/data/financialplans/total" />" /> 
		          </td>
		           <td colspan="1" class="thclass" width="300px">
			          &nbsp;
		          </td>
               </tr>						
            </table>
			<br>
			<table width="98%" align="center">
				<tr>
					<td>
					
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblfinancialplans',10,'只能填写10个项目资金使用计划')){addNewRow('tblfinancialplans');}try{top.resizeFrame();}catch(e){};">
					<!-- 
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblfinancialplans',3,'只能填写3个项目资金使用计划')){addNewRow('tblfinancialplans');}showDateTag('tblfinancialplans');try{top.resizeFrame();}catch(e){};">
					 -->
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblfinancialplans','selfinancialplans')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblfinancialplans','selfinancialplans')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblfinancialplans','进度');countTable('tblfinancialplans','financialplans_total','2');">
					</td>
				</tr>
	        </table>
